using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Player : MonoBehaviour
{

    CharacterController character;
    void Start()
    {
        character = GetComponent<CharacterController>();
    }
    public float speed = 3f;
    // Update is called once per frame
    void Update()
    {
        float h = Input.GetAxis("Horizontal");
        float v = Input.GetAxis("Vertical");

        float s = speed;
        if (Input.GetKey(KeyCode.LeftShift))
        {
            s *= 2;
        }

        transform.LookAt(new Vector3(h, 0, v) + transform.position);
        character.Move(new Vector3(h, 0, v) * s * Time.deltaTime);
    }
}
